'use strict';

const {
    Controller
} = require('egg');

class concernController extends Controller {

    // 关注路由
    async concern() {
        console.log(this.ctx.request.query);
        let usersql = `SELECT u2.touxiang AS cedtouxiang, u2.nickname AS cedname, bi.img
                     FROM user u
                     JOIN concern c ON u.uid = c.uid
                    JOIN user u2 ON c.concerned_id = u2.uid
                    JOIN draw_board db ON u2.uid = db.uid
                    JOIN b_img bi ON db.bid = bi.bid
                         /*登录的用户id*/
                         WHERE u.uid = 1`;
        let res = await this.ctx.app.mysql.query(usersql)
        console.log(res);
        this.ctx.body = {
            code: 200,
            info: res

        }
    }
}

module.exports = concernController;